<template>
  <div>
    <Oprate></Oprate>
    <doctorTable v-if="isRouterAlive" v-show="show"></doctorTable>
    <doctorTable2  v-if="isRouterAlive" v-show="show2"></doctorTable2>
  </div>
</template>

<script>
  import bus from '../../../bus';
  import Oprate from '../../../Oprate/Oprate1'
  import doctorTable from './doctorTable'
  import doctorTable2 from './doctorTable2'
  export default {
    components: {
      Oprate,doctorTable,doctorTable2
    },
    data() {
      return {
        show:true,
        show2:false,
        isRouterAlive: true,
      }
    },
    created() {
      // 通过 Event Bus 进行组件间通信，来折叠侧边栏
      bus.$on('refresh', msg => {
        if(msg == true){
          this.isRouterAlive = false;
          this.$nextTick(() => (this.isRouterAlive = true))
        }
      }),
        bus.$on('value7', msg => {
          if(msg==="上海"){
            this.show =false;
            this.show2 =true;
            this.isRouterAlive = false;
            this.$nextTick(() => (this.isRouterAlive = true))
          }else{
            this.show =true;
            this.show2 =false;
            this.isRouterAlive = false;
            this.$nextTick(() => (this.isRouterAlive = true))
          }
        })
    },
  };
</script>

<style scoped>
  .main-container {
    margin-right: 50px;
    padding: 10px 15px 80px;
    background-color: rgba(245, 245, 248, 0.1);
    border-radius: 10px;
    -webkit-box-shadow: 10px 5px 30px 10px rgba(0, 0, 0, 0.2);
    box-shadow: 10px 5px 30px 10px rgba(0, 0, 0, 0.2);
    background-image: url("../../../../assets/blur-bg-blurred.jpg");
    font-size: 14px;
  }

</style>
